package com.mall.controller;

import com.mall.db.service.BrandService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/brand/ud")
public class BrandUDController {
    @Resource(name = "brandService")
    private BrandService bs;
    @RequestMapping("/editBrand/{id}")
    public String editBrand(@PathVariable(name = "id") int id, ModelMap mmap) {
        mmap.addAttribute("b", bs.getById(id));
        return "/views/brand/brandEdit";
    }
}
